﻿using Md.Api.Entity.ModelDB;

namespace Md.Petapoco.Repositories.MdTrainingEducation;
/// <summary>
/// 课程观看记录仓储
/// </summary>
public class MdCourseWatchRep : BaseRep<MdCourseWatchModel>
{
    /// <summary>
    /// 获取观看记录
    /// </summary>
    /// <param name="courseId">课程编号</param>
    /// <param name="studentId">学生编号</param>
    /// <returns>MdCourseWatchModel</returns>
    public MdCourseWatchModel GetMdCourseWatch(long courseId,long studentId)
    {
        #region ===sql===
        string sqlStr = string.Format(@"
            select id
                  ,course_id
                  ,student_id
                  ,create_time
            from md_course_watch
            where 1 = 1 and course_id = @0 and student_id = @1
        ");
        #endregion

        return MdTrainingEducationDB.GetInstance().SingleOrDefault<MdCourseWatchModel>(sqlStr, courseId, studentId);
    }
}

